package com.spider.staticmethod;

public class Student {
    private double  score;
    //静态方法：有static修饰，属于类特有
    public static void show() {
        System.out.println("静态方法");
        System.out.println("静态方法");
        System.out.println("静态方法");
        System.out.println("静态方法");
    }
    //实例方法：没有static修饰，属于对象特有
    public void show2() {
        System.out.println("实例方法");
        System.out.println("实例方法");
        System.out.println("实例方法");
        System.out.println("实例方法");
    }
    //打印学生成绩
    public void printScore() {
        if (score >= 0&& score <= 100) {
            if (score >= 60) {
                System.out.println("通过");
            } else {
                System.out.println("不及格");
            }
        } else {
            System.out.println("输入的分数有误");
        }
        System.out.println("学生成绩是：" + score);
    }

    public void setScore(double score) {
        this.score = score;
    }
}
